<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<body>
<style type="text/css">
	#tbClassHome{
		padding: 15px;
		background: #fff;
		border-radius: 10px;
	}
	.layui-inline{
		width:45%;
	}
	.layui-input-block{
		margin-left: 135px;
	}
	.layui-form-label{
		width: 100px;
	}
</style>
<div id="tbClassHome">
	<fieldset class="layui-elem-field layui-field-title site-title">
		<legend><a name="fixbar">班级添加</a></legend>
	</fieldset>
	<form id="tbClassForm" method="post" class="layui-form white-bg radius">
		<input type = "hidden" name = "limit" value="${param.limit}">
		<input type = "hidden" name = "page" value="${param.page}">
		<input type="hidden" name="id" value="${model.id}">
		<input type="hidden" name="isUsed" value="${model.isUsed}">
		<input type="hidden" name="classNumber" value="${model.classNumber}">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">班级</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="name" value="${model.name}">
				</div>
			</div>
			<div class="layui-inline"> 
				<label class="layui-form-label">培训主题</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="subject" value="${model.subject}">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">班级类型</label>
				<div class="layui-input-block">
					<select name = "ctype.id">
						<c:forEach items="${type}" var = "c">
							<option value="${c.id}" <c:if test='${model.ctype.id == c.id}'>selected</c:if>>${c.type}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">班级人数</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="classSize" value="${model.classSize}">
				</div>
			</div>
		</div>
		<c:choose>
			<c:when test='${model.classStatus.id != null}'>
				<c:choose>
					<c:when test="${model.classStatus.state == '结业'}">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">报名开始时间</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="regBeginTime" readonly="readonly" value="${model.regBeginTime}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">报名结束时间</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="regEndTime" readonly="readonly" value="${model.regEndTime}">
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">开班日期</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="startTime" readonly="readonly" value="${model.startTime}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">结业日期</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="closeTime" readonly="readonly" value="${model.closeTime}">
								</div>
							</div>
						</div>
					</c:when>
					<c:when test="${model.classStatus.state == '开班'}">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">报名开始时间</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="regBeginTime" readonly="readonly" value="${model.regBeginTime}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">报名结束时间</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="regEndTime" readonly="readonly" value="${model.regEndTime}">
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">开班日期</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" name="startTime" readonly="readonly" value="${model.startTime}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">结业日期</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" id="closeTime" name="closeTime" value="${model.closeTime}">
								</div>
							</div>
						</div>
					</c:when>
					<c:otherwise>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">报名开始时间</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" id="regBeginTime" name="regBeginTime" value="${model.regBeginTime}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">报名结束时间</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" id="regEndTime" name="regEndTime" value="${model.regEndTime}">
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-label">开班日期</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" id="startTime" name="startTime" value="${model.startTime}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">结业日期</label>
								<div class="layui-input-block">
									<input type="text" class="layui-input" id="closeTime" name="closeTime" value="${model.closeTime}">
								</div>
							</div>
						</div>
					</c:otherwise>
				</c:choose>
			</c:when>
			<c:otherwise>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">报名开始时间</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" id="regBeginTime" name="regBeginTime" value="${model.regBeginTime}">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">报名结束时间</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" id="regEndTime" name="regEndTime" value="${model.regEndTime}">
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">开班日期</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" id="startTime" name="startTime" value="${model.startTime}">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">结业日期</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" id="closeTime" name="closeTime" value="${model.closeTime}">
						</div>
					</div>
				</div>
			</c:otherwise>
		</c:choose>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">班级状态</label>
				<div class="layui-input-block">
					<select name = "classStatus.id">
						<c:forEach items="${state}" var = "c">
							<option value="${c.id}" <c:if test='${model.classStatus.id == c.id}'>selected</c:if>>${c.state}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">备注</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="memo" value="${model.memo}">
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">辅导员</label>
				<div class="layui-input-block">
					<%-- <input type="text" class="layui-input" id="startTime" name="instructor.id" value="${model.instructor}"> --%>
					<select name = "instructor.id" lay-search>
						<option></option>
						<c:forEach items="${teacher}" var = "c">
							<option value="${c.id}" <c:if test='${model.instructor.id == c.id}'>selected</c:if>>${c.name}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">后勤服务员</label>
				<div class="layui-input-block">
					<%-- <input type="text" class="layui-input" id="closeTime" name="logistics" value="${model.logistics}"> --%>
					<select name = "logistics.id" lay-search>
						<option></option>
						<c:forEach items="${teacher}" var = "c">
							<option value="${c.id}" <c:if test='${model.logistics.id == c.id}'>selected</c:if>>${c.name}</option>
						</c:forEach>
					</select>
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">班主任</label>
				<div class="layui-input-block">
					<select name = "teacherId.id" lay-search>
						<c:forEach items="${teacher}" var = "c">
							<option value="${c.id}" <c:if test='${model.teacherId.id == c.id}'>selected</c:if>>${c.name}</option>
						</c:forEach>
					</select>
				</div>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	form=layui.form;
	form.render('select');
	
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		laydate.render({
			elem: '#regBeginTime',
		});
		laydate.render({
			elem: '#regEndTime',
		});
		laydate.render({
			elem: '#startTime',
		});
		laydate.render({
			elem: '#closeTime',
		});
	});
</script>
</body>
